import java.util.Scanner;

public class Test {

    //统计1到N的整数中，被A除余A—1的偶数的个数
    public static void main(String[] args) {
        int count=0;
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入N的值：");
        int N=scan.nextInt();
        System.out.println("请输入A的值：");
        int A=scan.nextInt();
        for (int i = 1; i <= N; i++) {
            if(i%2==0){
                if(i%A==A-1){
                    System.out.print(i+" ");
                    count++;
                }
            }
        }
        System.out.println();
        System.out.println("个数为：");
        System.out.println(count);
    }
}
